<style scoped>
  .layout{
    border: 1px solid #d7dde4;
    background: #f5f7f9;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
  }
  .layout-breadcrumb{
    padding: 10px 15px 0;
  }
  .layout-content{
    min-height: 500px;
    margin: 10px;
    overflow: hidden;
    background: #fff;
    border-radius: 4px;
  }
  .layout-content-main{
    padding: 10px;
  }
  .layout-copy{
    text-align: center;
    padding: 10px 0 20px;
    color: #9ea7b4;
  }
  .layout-menu-left{
    background: #464c5b;
  }
  .layout-header{
    height: 45px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
  }
  .layout-logo-left{
    width: 100%;
    height: 30px;
    background: #5b6270;
    border-radius: 3px;
    margin: 15px auto;
  }
  .layout-ceiling-main a{
    color: #9ba7b5;
  }
  .layout-hide-text .layout-text{
    display: none;
  }
  .ivu-col{
    transition: width .2s ease-in-out;
  }
</style>
<template>
  <div class="layout" :class="{'layout-hide-text': spanLeft < 5}">
    <Row type="flex">
      <Col :span="spanLeft" class="layout-menu-left" align="left">
      <Menu active-name="1-2" theme="dark" width="auto" :open-names="['1']">
        <div class="layout-logo-left"></div>
        <MenuGroup title="案例库">
          <MenuItem name="person">
            <router-link to="/person">
              <Icon type="person"> </Icon>
              person
            </router-link>
          </MenuItem>
        </MenuGroup>
        <MenuGroup title="基础">
        <Submenu name="2">
          <template slot="title">
            <Icon type="ios-keypad"></Icon>
            系统设置
          </template>
          <MenuItem name="userMgr">
            <router-link to="/userMgr">
              用户管理
            </router-link>
          </MenuItem>
          <MenuItem name="roleList">
            <router-link to="/roleList">
              角色管理
            </router-link>
          </MenuItem>
          <MenuItem name="userGroup">
            <router-link to="/userGroup">
              用户组管理
            </router-link>
          </MenuItem>
          <MenuItem name="parameter">
            <router-link to="/parameter">
              系统参数
            </router-link>
          </MenuItem>
          <MenuItem name="deptMgr">
            <router-link to="/paas/deptMgr">
              部门管理
            </router-link>
          </MenuItem>
          <MenuItem name="orgMgr">
            <router-link to="/paas/orgMgr">
              组织管理
            </router-link>
          </MenuItem>
          <MenuItem name="resourceMgr">
            <router-link to="/paas/resourceMgr">
              资源管理
            </router-link>
          </MenuItem>
          <MenuGroup title="编码管理">
            <MenuItem name="codeTypeMgrList">
              <router-link to="/paas/codeTypeMgrList">
                通用编码
              </router-link>
            </MenuItem>
            <MenuItem name="codingGrid">
              <router-link to="/paas/codingGrid">
                编码列表
              </router-link>
            </MenuItem>
          </MenuGroup>
          <MenuGroup title="表格管理">
            <MenuItem name="dataGrid">
              <router-link to="/paas/dataGrid">
                表格管理
              </router-link>
            </MenuItem>
            <MenuItem name="dataGridColumn">
              <router-link to="/paas/dataGridColumn">
                表格列管理
              </router-link>
            </MenuItem>
          </MenuGroup>
        </Submenu>
        <Submenu name="3">
          <template slot="title">
            <Icon type="ios-analytics"></Icon>
            用户中心
          </template>
          <MenuItem name="profile">
            <router-link to="/paas/account/profile">
              账号管理
            </router-link>
          </MenuItem>
          <MenuItem name="allMess">
            <router-link to="/paas/mess/allMess">
              消息中心
            </router-link>
          </MenuItem>
        </Submenu>
        <Submenu name="4">
          <template slot="title">
            <Icon type="ios-analytics"></Icon>
            测试
          </template>
          <MenuItem name="employee">
            <router-link to="/paas/test/employee">
              员工管理
            </router-link>
          </MenuItem>
        </Submenu>
        </MenuGroup>
      </Menu>
      </Col>
      <Col :span="spanRight" >
      <div class="layout-header" align="left">
        <Button type="text" @click="toggleClick">
          <Icon type="navicon" size="32"></Icon>
        </Button>

      </div>
      <div class="layout-content" style="color: lightgray">
        <div class="layout-content-main" align="left">
          <router-view></router-view>
        </div>
      </div>
      <div class="layout-copy">
        上海新致软件股份有限公司 | © 版权所有 2016
      </div>
      </Col>
    </Row>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        spanLeft: 5,
        spanRight: 19,
        model1: ''
      }
    },
    computed: {
      iconSize () {
        return this.spanLeft === 5 ? 14 : 24
      }
    },
    methods: {
      toggleClick () {
        if (this.spanLeft === 5) {
          this.spanLeft = 2
          this.spanRight = 22
        } else {
          this.spanLeft = 5
          this.spanRight = 19
        }
      }
    }
  }
</script>
